# -*- coding:utf-8 -*-
"""
客户端加一个全局锁，
避免在模拟键盘输入时，
被键盘监控线程监控到然后发送到服务器，形成死循环

"""


class GlobalVar:
    global_lock = 'unlock'
    global_client_list_cache = False
    global_switch_cache = False


def set_lock(lock_flag):
    GlobalVar.global_lock = lock_flag


def get_lock():
    return GlobalVar.global_lock


def set_list(global_client_list_cache):
    GlobalVar.global_client_list_cache = global_client_list_cache


def get_list():
    return GlobalVar.global_client_list_cache


def set_switch(global_switch_cache):
    GlobalVar.global_switch_cache = global_switch_cache


def get_switch():
    return GlobalVar.global_switch_cache
